# @File: login_operation.py

from appium.webdriver.common.appiumby import AppiumBy

class LoginPlace:
    # 跳过
    tv_skip = (AppiumBy.XPATH, '//android.widget.TextView[@resource-id="com.qxdj.mall:id/tv_skip"]')

    # 定位tab我的
    item_me = (AppiumBy.ID, "com.qxdj.mall:id/item_me")

    # 登录入口
    tv_login = (AppiumBy.ID, 'com.qxdj.mall:id/tv_login')

    # 输入手机号编辑框
    et_phone_num = (AppiumBy.ID, "com.qxdj.mall:id/et_phone_num")

    # 验证码按钮
    btn_obtain_sms = (AppiumBy.ID, "com.qxdj.mall:id/btn_obtain_sms")

    # 验证码编辑框
    EditText = (AppiumBy.XPATH, '//android.widget.EditText[@text="获取验证码"]')
    # EditText = (AppiumBy.ID, "om.qxdj.mall:id/cl_code")

    # 勾选协议
    cb_protocal = (AppiumBy.ID, "com.qxdj.mall:id/cb_protocal")

    # 手机登录按钮
    tv_mobile_login = (AppiumBy.ID, "com.qxdj.mall:id/tv_mobile_login")

    # VIP权益文本（用于断言）
    tv_vip_right = (AppiumBy.ID, "com.qxdj.mall:id/tv_vip_right")

    # 退出界面
    tv_text_set = (AppiumBy.XPATH, '//android.widget.TextView[@resource-id="com.qxdj.mall:id/tv_text" and @text="信息设置"]')

    # 退出登录
    tv_sign_out = (AppiumBy.ID, 'com.qxdj.mall:id/tv_sign_out')

    # 退出登录(断言)
    assert_tv_sign_out = (AppiumBy.XPATH, '//android.widget.Toast[@text="退出登录成功"]')


